const state = {
    //路由缓存
    includeRoutes: []
}
const mutations = {
    addKeepAliveRoute(state, name) {
        if (!state.includeRoutes.includes(name)) {
            state.includeRoutes.push(name)
        }
    },
    removeAliveRoute(state, name) {
        let index
        if (-1 != (index = state.includeRoutes.indexOf(name) )) {
            state.includeRoutes.splice(index,1);
        }
    }
}
const getters = {
    dynamicRoutes(state){
        return state.includeRoutes;
    }
}
export default {
    state,
    mutations,
    getters
}
